import {Coolcar} from "./request";

export namespace ProfileService{
    export function getProfile():Promise<any>{
        return Coolcar.sendRequestWithAuthRetry({
            method:"GET",
            path:"/v1/profile",
        })
    }

    export function submitProfile(req:any):Promise<any>{
        return Coolcar.sendRequestWithAuthRetry({
            method:"POST",
            path:"/v1/profile",
            data:req
        })
    }

    export function clearProfile():Promise<any> {
        return Coolcar.sendRequestWithAuthRetry({
            method: "DELETE",
            path: "/v1/profile",
        })
    }

    export function getProfilePhoto(){
        return Coolcar.sendRequestWithAuthRetry({
            method: "GET",
            path: "/v1/profile/photo",
        })
    }

    export function createProfilePhoto():Promise<any>{
        return Coolcar.sendRequestWithAuthRetry({
            method: "POST",
            path: "/v1/profile/photo",
        })
    }

    export function completeProfilePhoto():Promise<any>{
        return Coolcar.sendRequestWithAuthRetry({
            method: "POST",
            path: "/v1/profile/photo/complete",
        })
    }

    export function clearProfilePhoto():Promise<any>{
        return Coolcar.sendRequestWithAuthRetry({
            method:"DELETE",
            path:"/v1/profile/photo",
        })
    }
}